** These Stata codes are intended to replicate the Tables and Figures and figures in the following paper (see ReadMe.pdf for details).
** Park, J., Son, Y., and Angst, C., 2022. “Value of Centralized IT in Building Resilience During Crises: Evidence from U.S. Higher Education’s Transition to Emergency Remote Teaching”.



** Data Load 

use "RMP Data.dta", clear


* Data Merge

merge m:1 IPEDS_Code year using "IT Investment.dta"
keep if _merge==3
drop _merge

merge m:1 IPEDS_Code year using "Institutional Characteristics.dta"
keep if _merge==3
drop _merge

merge m:1 IPEDS_Code using "ERT Transition.dta"
drop if _merge==2
drop _merge



** Variable Construction

encode  year_quarter , gen(time)
quietly tab year_quarter, gen(dum_year_quarter)
gen quarter = substr(year_quarter, 5, 1)
destring quarter, replace

xtset IPEDS_Code time


* Define the After-COVID Indicator
gen after_covid_quarterly = 0
replace after_covid_quarterly = dum_year_quarter14 + dum_year_quarter15


* Institutional Types
gen private = 0
replace private = 1  if Sectorofinstitution==2
gen doctorate = 0
replace doctorate = 1  if CarnegieClassification==15 | CarnegieClassification==16 | CarnegieClassification==17
gen master = 0
replace master = 1  if CarnegieClassification==18 | CarnegieClassification==19 | CarnegieClassification==20
gen with_medical = 0
replace with_medical = 1 if medicaldegree==1


* Institutional Characteristics
gen transition_ERT = 0
replace transition_ERT = 1 if transition_date != .

gen lnStudent_FTE = ln(student_FTE)
egen avg_Student_FTE = mean(student_FTE), by(IPEDS_Code)

gen Endowment_Student = Valueofendowmentassets / student_FTE
gen lnEndowment_Student = ln((Valueofendowmentassets+1)/student_FTE)

gen lnExpense_Instruction_Student = ln( Expense_Instruction_Student +1)
gen lnExpense_AcademicSupp_Student = ln( Expense_AcademicSupport_Student +1)
gen lnExpense_StudentService_Student = ln( Expense_StudentService_Student +1)

gen lnNum_Course_Student = ln(num_course/student_FTE)
gen lnNum_Professor_Student = ln(num_professor/student_FTE)
